コード例 #1
0
 public CropPeas() {
   super();
   float f = 0.5F;
   this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.35F, 0.5F + f);
   this.setCreativeTab((CreativeTabs) null);
   ZollernHelper.setName(this, "peas");
   ZollernHelper.setTexture(this, "peas");
   this.setTickRandomly(true);
   this.disableStats();
 }
コード例 #2
0
 @Override
 public boolean onItemUse(
     ItemStack par1ItemStack,
     EntityPlayer par2EntityPlayer,
     World par3World,
     int par4,
     int par5,
     int par6,
     int par7,
     float par8,
     float par9,
     float par10) {
   EntityPlayer player = par2EntityPlayer;
   ExtendedPlayer props = ExtendedPlayer.get(player);
   if (!player.capabilities.isCreativeMode) {
     float maxHealth = player.getMaxHealth();
     IAttributeInstance attrMaxHealth =
         player.getEntityAttribute(SharedMonsterAttributes.maxHealth);
     if (attrMaxHealth.getAttributeValue() < dblMaxHealthLimit
         && props.getMaxHealth() < dblMaxHealthLimit) {
       maxHealth += healthIncreaseAmount;
       player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealth);
       player.setHealth(maxHealth);
       props.setMaxHealth(maxHealth);
       par1ItemStack.damageItem(2, par2EntityPlayer);
       if (!player.worldObj.isRemote) {
         ZollernHelper.addChatMessage(
             player,
             EnumChatFormatting.GOLD
                 + "+"
                 + this.healthIncreaseAmount
                 + " Max Health! Total: "
                 + props.getMaxHealth());
       }
     } else {
       ZollernHelper.addChatMessage(player, "Max health cannot exceed " + dblMaxHealthLimit + ".");
     }
   }
   return true;
 }
コード例 #3
0
 public SapphireSword() {
   super(ToolMaterials.SAPPHIRE);
   ZollernHelper.setNameAndTexture(this, "sapphiresword");
 }
コード例 #4
0
 public NetherSword(ToolMaterial p_i45347_1_) {
   super(p_i45347_1_);
   ZollernHelper.setTab(this);
   ZollernHelper.setNameAndTexture(this, "nethersword");
 }